<template>
  <div id="app">
    <h1>根据localstorage中的权限来控制按钮的存在与否</h1>
    <p>现在localstorage中添加</p>
    <button v-has="'create'">创建</button>
    <button v-has="'delete'">删除</button>
    <button v-has="'edit'">修改</button>
  </div>
</template>

<script>
//1引入指令对象
// import hasDirective from "./directives/has.js";

export default {
  name: "App",
  // directives: {
  //   //在directives配置项中配置has指令
  //   has: hasDirective,
  // },
  mounted() {
    console.log("mounted");
  },
};
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
